package com.yanqu.road.server.timer.vehicle;

import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.cricket.CricketModule;
import com.yanqu.road.server.gameplayer.module.manor.ManorFishPondModel;
import com.yanqu.road.server.gameplayer.module.manor.ManorModule;
import com.yanqu.road.server.gameplayer.module.vehicle.VehicleModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.executor.GeneralTask;

public class VehicleBindingTask extends GeneralTask {
    @Override
    public void doRun() {
        try {
            for (GamePlayer player : GamePlayerMgr.getPlayerMap().values()) {
                player.getModule(VehicleModule.class).checkAndReset();
                player.getModule(VehicleModule.class).checkVehicleBindingActivity();

                ManorFishPondModel fishPondModel = player.getModule(ManorModule.class).getManorFishPondModel();
                if (fishPondModel != null) {
                    fishPondModel.checkAndReset();
                    fishPondModel.checkVehicleBindingActivity();
                }

                player.getModule(CricketModule.class).checkAndReset();
            }
        } catch (Exception e) {

        }
    }
}
